package com.ln.aop01;

import com.ln.aop01.service.UserService;
import com.ln.aop01.serviceImpl.OrderService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/11 16:03
 */
public class Test {
    public static void main(String[] args) {
        //读取spring配置文件
        ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("spring01.xml");
        //该类使用了接口---使用JDK动态代理
        UserService userService = classPathXmlApplicationContext.getBean(UserService.class);
        userService.save();
        //该类没有实现接口---切面使用cglib动态代理
//        OrderService orderService = classPathXmlApplicationContext.getBean(OrderService.class);
//        orderService.save();

    }
}
